<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires",0);
//response.setHeader("Content-type","application/vnd.ms-excel");
response.setHeader("Content-disposition","inline; filename=Licencias.xls");
response.reset();
response.setHeader("Content-type","application/xls");
//response.setHeader("Content-disposition","inline; filename=nombre.csv");
%>

<%@ page language="java" import='java.util.ArrayList'%>
<%@ page language="java" import='java.util.List'%>
<%@ page language="java" import='pe.gov.mtc.dgac.licencias.bean.*'%>
<%@ page language="java" import='pe.gov.mtc.dgac.licencias.util.*'%>
<%@ page language="java" import='java.text.DecimalFormat'%>
<% String busqueda=request.getParameter("busqueda");
   boolean bus=false;
   if(busqueda!=null)bus=true; 
%>
<html><head><title>LISTADO DE DATOS</title>
<!--base target="_self"--> 
<link href="/WebLicenciasNew/css/espacio.css" type=text/css rel=stylesheet>
<link href="/WebLicenciasNew/css/calendar-system.css" type=text/css rel=stylesheet>
<script language="javascript" src="/WebLicenciasNew/js/calendar.js"></script>
<script language="javascript" type="text/javascript" src="/WebLicenciasNew/js/js.Farmacia.Function.js"></script>
<script language="javascript" src="/WebLicenciasNew/js/calendar-es.js"></script>
<script language="javascript" src="/WebLicenciasNew/js/utils.js"></script>
</head>
<body>

<div id="idTabla" style="DISPLAY: inline">
    <table width="100%" align="center" bgcolor="#fffdd6" border="0">
  <tbody>
  <tr>
    <td>
      <div class="Titulo1B" align="center">LICENCIAS AERONAUTICAS</div></td></tr>
  <tr>
    <td>
      <div id="res">
      <br>
      <table class="consultanormal" id="row" cellspacing="0" align="center">
        <thead>
        <tr>
          
          <th class="sortable" width="15%"><a style="COLOR: white" href="#">No 
            Licencia</a></th>
          <th class="sortable" width="20%"><a style="COLOR: white" 
            href="#">Cliente&nbsp;</a></th>
          <th class="sortable" width="10%"><a style="COLOR: white" href="#">Tipo 
            Licencia</a></th>
          <th class="sortable" width="15%"><a style="COLOR: white" 
            href="#">Fecha Otorgamiento</a></th>
          <th class="sortable" width="15%"><a style="COLOR: white" href="#">No 
            Documento</a></th>
          <th class="sortable" width="15%"><a style="COLOR: white" 
            href="#">Observaciones</a></th></tr></thead>
        <tbody>
         
        <%
           
           Page result = (Page) request.getSession().getAttribute("listClienteLicencias");
           int hits=0;
           if (result!=null){
               ArrayList listclilic=(ArrayList) result.getResults();
           if (listclilic!=null) {
           hits=listclilic.size(); 
           for (int i = 0; i < listclilic.size(); i++) {
                    ClientelicenciaTO clilic = (ClientelicenciaTO) listclilic.get(i);
                    String[] clase = {"odd","even"};
         %>
        
        <tr class="<%=(clase[i%2])%>">
         
          <td class="TextoTabla8">
            <div align="center"><%=clilic.getNumLic()%></div></td>
          <td class="TextoTabla8">
            <div align="center"><%=clilic.getClienteTO().getApellidoPat()+" "+ clilic.getClienteTO().getApellidoMat()+" "+clilic.getClienteTO().getNombres()%></div></td>
          <td class="TextoTabla8">
            <div align="center"><%=clilic.getLicenciaTO().getDescripcion()%></div></td>
          <td class="TextoTabla8">
            <div align="center"><%=clilic.getSfechaOtorgamiento() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%=clilic.getClienteTO().getNumIdDoc()%></div></td>
          <td class="TextoTabla8">
            <div align="center"><%=clilic.getObservaciones()%></div></td>
        </tr>
        <%
          }
        }
       }
           if(hits==0){
            %>
            <tr class="odd">
          
          <td class="TextoTabla8">
            <div align="center"></div></td>
          <td class="TextoTabla8">
            <div align="center"></div></td>
          <td class="TextoTabla8">
            <div align="center"></div></td>
          <td class="TextoTabla8">
            <div align="center"></div></td>
          <td class="TextoTabla8">
            <div align="center"></div></td>
          <td class="TextoTabla8">
            <div align="center"></div></td>
          </tr>
            <%
           }
        %>    
      </tbody>
      </table>
 
</body></html>
